﻿using System;
using Ninject;
using Legazpi.Payroll.BusinessLogic.Services.Interfaces;
using Legazpi.Payroll.DataAccess.DataObjects;
using Legazpi.Payroll.Web.Helpers;

namespace Legazpi.Payroll.Web.PopupBoxes
{
    public partial class PayrollDateDialogbox : System.Web.UI.Page
    {
        [Inject]
        public IPayrollDateService _payrollDateService { get; set; }
        protected PayrollDate PreviousPaydate { get; private set; }
        protected string strPayrollPeriod { get; private set; }

        protected void Page_Load(object sender, EventArgs e)
        {
            PreviousPaydate = _payrollDateService.GetPreviousPayroll();
            var payrollPeriod   = Helper.GetPayrollPeriod();
            strPayrollPeriod = string.Format("{0} - {1}", payrollPeriod.StartDate.ToShortDateString(), 
                payrollPeriod.EndDate.ToShortDateString());
        }
    }
}